package com.example.myunisdkdemo;

import android.app.Application;
import android.content.Context;

import com.example.bridgemodule.UniBridgeModule;

import io.dcloud.feature.sdk.DCSDKInitConfig;
import io.dcloud.feature.sdk.DCUniMPSDK;
import io.dcloud.feature.uniapp.UniSDKEngine;

public class App extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        initUniSDK(this);
    }

    /**
     * 初始化UniSDK
     *
     * @param context 实例
     */
    private void initUniSDK(Context context) {
        DCSDKInitConfig config = new DCSDKInitConfig.Builder()
                .setCapsule(false)
                .setEnableBackground(false)
                .build();
        DCUniMPSDK.getInstance().initialize(context, config);
        UniSDKEngine.registerModule("UniBridgeModule", UniBridgeModule.class);

    }
}
